package com.itheima.d3_collections;

//1.基于Demo03的需求，定义的扑克类
public class Poker {
    //2.属性：花色，点数，id属性（用于根据斗地主规则对点数进行排序，点数小的id小，点数大的id大）
    private String hua;
    private String dian;
    private int id;

    //3.空参、有参构造
    public Poker() {
    }

    public Poker(String hua, String dian, int id) {
        this.hua = hua;
        this.dian = dian;
        this.id = id;
    }

    //4.Getter and Setter方法
    public String getHua() {
        return hua;
    }

    public void setHua(String hua) {
        this.hua = hua;
    }

    public String getDian() {
        return dian;
    }

    public void setDian(String dian) {
        this.dian = dian;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    //5.toString方法
    @Override
    public String toString() {
        //在这个需求中，id不用展示，只是用来排序。要展示的格式：花色+点数
        return hua + dian;
    }
}
